package com.alex.taskmanager.dao;

import com.alex.taskmanager.service.TaskExecutor;

public class TaskData<ParamType> {

	private int id;

	private String name;

	private TaskStatus status;

	private int executionTime;

	private TaskExecutor<ParamType> executor;

	private ParamType parameters;

	private int retryNumber;

	private int maxRetries;

	public TaskData() {
	}

	public TaskData(String name, TaskStatus taskStatus, int executionTime, TaskExecutor<ParamType> taskExecutor, ParamType parameters,
			int maxRetries) {
		this.name = name;
		this.status = taskStatus;
		this.executionTime = executionTime;
		this.executor = taskExecutor;
		this.parameters = parameters;
		this.maxRetries = maxRetries;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public TaskStatus getStatus() {
		return status;
	}

	public void setStatus(TaskStatus taskStatus) {
		this.status = taskStatus;
	}

	public int getExecutionTime() {
		return executionTime;
	}

	public void setExecutionTime(int executionTime) {
		this.executionTime = executionTime;
	}

	public TaskExecutor<ParamType> getExecutor() {
		return executor;
	}

	public void setExecutor(TaskExecutor<ParamType> taskExecutor) {
		this.executor = taskExecutor;
	}

	public ParamType getParameters() {
		return parameters;
	}

	public void setParameters(ParamType parameters) {
		this.parameters = parameters;
	}

	public int getRetryNumber() {
		return retryNumber;
	}

	public void setRetryNumber(int retryNumber) {
		this.retryNumber = retryNumber;
	}

	public int getMaxRetries() {
		return maxRetries;
	}

	public void setMaxRetries(int maxRetries) {
		this.maxRetries = maxRetries;
	}

	public void incRetryNumber() {
		this.retryNumber++;
	}
}
